n,m,x=map(int,input().split())
arr=[0]+list(map(int,input().split()))

# def check(left,right):
#     if left>=right:
#         return "no"
#     for i in range(left,right+1):
#         for j in range(left+1,right+1):
#             if arr[i]^arr[j]==x:
#                 return "yes"
#     return "no"

def check(left, right):
    if left >= right:
        return "no"

    seen = set()
    for i in range(left, right + 1):
        complement = x ^ arr[i]
        if complement in seen:
            return "yes"
        seen.add(arr[i])

    return "no"

for i in range(m):
    j,k=map(int,input().split())
    print(check(j,k))